<?php

// +----------------------------------------------------------------------
// | Apprh.Shop
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2027 http://www.apprh.com All rights reserved.
// +----------------------------------------------------------------------
// | Notice: This code is not open source, it is strictly prohibited
// |         to distribute the copy, otherwise it will pursue its
// |         legal responsibility.
// +----------------------------------------------------------------------
// | Author: 雲溪荏苒 <290648237@qq.com>
// +----------------------------------------------------------------------

namespace app\frontend\controller;

use controller\HomeBase;


/**
 * 视频控制器
 *
 * Class Video
 * @package app\frontend\controller
 * @author 雲溪荏苒 <290648237@qq.com>
 * @date 2017/12/16
 */
class Video extends HomeBase
{

    /**
     * 视频
     * @return mixed
     */
    public function index()
    {
        $this->assign('generator', request()->domain().'/,cn,178,,5,M1156010');
        $this->assign('body_class', 'class-178');

        // 获取视频列表
        list($videoList, $total) = model('video')->getList(['status' => 1]);
        $this->assign('videoList', $videoList);

        // SEO
        $this->assign('seo_title', '网站设计推荐视频,网站建设推荐视频,网站制作推荐视频 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', '网站设计推荐视频,网站建设推荐视频,网站制作推荐视频,立鼎科技精品推荐视频,'.sysconf('seo_keywords'));
        $this->assign('seo_description', '知名网站建设公司立鼎科技的网站视频，凭借优质的服务品质，超前的设计理念为众多企业提供优质的官方网站，做网站请选立鼎科技，了解更多精品推荐视频请致电'.sysconf('hc_phone').'。'.sysconf('seo_description'));

        return $this->fetch('');
    }



    public function show()
    {
        $info = db('video')->findOrFail(I('video_id'));
        $this->assign('info', $info);

        $this->assign('generator', request()->domain().'/,cn,178,89,5,M1156010');
        $this->assign('body_class', 'class-178');

        // 推荐视频
        list($recVideoList, $vTotal) = model('video')->getList(['status' => 1, 'is_recommend' => 1], 0, 6, 'view desc');
        $this->assign('recVideoList', $recVideoList);

        // 访问量+1
        model('video')->setViewInc(I('video_id'));

        list($previous, $next) = model('video')->getFrontAfterVideo(I('video_id'));
        $this->assign('previous', $previous);
        $this->assign('next', $next);

        $this->assign('seo_title', '网站设计推荐视频,网站建设推荐视频,网站制作推荐视频 - '.sysconf('seo_title'));
        $this->assign('seo_keywords', '网站设计推荐视频,网站建设推荐视频,网站制作推荐视频,立鼎科技精品推荐视频,'.sysconf('seo_keywords'));
        $this->assign('seo_description', '知名网站建设公司立鼎科技的网站视频，凭借优质的服务品质，超前的设计理念为众多企业提供优质的官方网站，做网站请选立鼎科技，了解更多精品推荐视频请致电'.sysconf('hc_phone').'。'.sysconf('seo_description'));

        return $this->fetch('');
    }
}
